import request from '@utils/request'

//周报总览列表接口GET 开发中 /api/work/week/weeksdisplay
export const getAllWeekList = () => {
    return request.get(`/api/work/week/weeksdisplay`)
}

//周计划
export const getList = (data) => {
    return request.get(`/api/work/week/list?uid=${data.uid}&page=${data.pageNo}&pagesize=${data.pageSize}`)
}
export const getDetail = (data) => {
    return request.get(`/api/work/week/detail?id=${data}`)
}
export const weekAdd = (data) => {
    return request.post(`/api/work/week/add`, data)
}
export const weekEdit = (data) => {
    return request.post(`/api/work/week/save`, data)
}
export const weekDel = (data) => {
    return request.get(`/api/work/week/del?id=${data.id}&uid=${data.uid}`)
}
//获取当周本周周报内容
export const weekPLanCount = (data) => {
    return request.get(`/api/work/week/preweekdeail?uid=${data.uid}&project_id=${data.project_id}`)
}

//月计划
export const getMonthList = (data) => {
    return request.get(`/api/work/month/list?uid=${data.uid}&page=${data.pageNo}&pagesize=${data.pageSize}`)
}
export const monthAdd = (data) => {
    return request.post(`/api/work/month/add`, data)
}
export const monthEdit = (data) => {
    return request.post(`/api/work/month/save`, data)
}
export const monthDel = (data) => {
    return request.get(`/api/work/month/del?id=${data.id}&uid=${data.uid}`)
}
export default {
    getAllWeekList, getList, getDetail,
    weekAdd, weekEdit, weekDel, weekPLanCount,
    getMonthList, monthAdd, monthEdit, monthDel
}